<?php


Route::get("/", function (){
    return 123;
});
Route::get('city', 'CommonController@city');

Route::post("/login", "AuthController@login"); // 登陆
Route::post("/register", "AuthController@register");// 注册
Route::post("/phone-login", "AuthController@phoneLogin"); // 手机登录

Route::group(['middleware'=>'auth:app'],function (){

    Route::post("/userInfo", "MemberController@save");// 注册



});
//todo 奖金池
Route::group(["prefix" => "bonus"],function (){
    Route::get('amount', "BonusPoolController@index"); // 获取奖金池金额,当前排队人数， 我排名
    Route::get('income',"BonusPoolController@income"); // 进入资金池日志列表
    Route::get('history-turnover',"BonusPoolController@historyTurnover"); // 历史营业额列表
    Route::get('reflect', "BonusPoolController@reflect"); // 资金池体现列表
    Route::get("queue-member", "BonusPoolController@queueMember"); // 获取当前排队人数列表
    Route::get("queue-member-prize", "BonusPoolController@getMemberBonusQueue"); // 获奖人数列表
    Route::get("member-order","BonusPoolController@memberOrder"); // 在线消费人数
});

Route::get("/test", "MoneyCommonController@test");

Route::group(['prefix' => 'index'], function () {
    Route::get('category', 'IndexController@categories');
    Route::get('store', 'IndexController@stores');
    Route::get('slide', 'IndexController@slide');
    Route::get('boot-page', 'IndexController@bootPage');
});

// todo 公用接口

Route::post('upload-file','CommonController@uploadFile'); // 上传图片

Route::post('send-sms-code',"CommonController@sendSmsCode"); // 发送短信验证码

Route::group(['prefix' => 'member', 'middleware' => 'auth:app'], function() {
    //用户
    Route::get('favorite', 'MemberController@favorite');//收藏
    Route::post('favorite', 'MemberController@favoriteStore');
    Route::post('unFavorite', 'MemberController@unFavorite');
    Route::get('order', 'MemberOrderController@orderList');
    Route::get('info','MemberController@info'); // 获取用户基本信息
    Route::post('retrieve-password', 'MemberController@retrievePassword'); // 修改密码
    Route::post('modify-phone','MemberController@modifyPhone'); // 修改密码
    Route::post('save', "MemberController@save"); // 完善信息
    Route::get('comment', 'MemberController@comment');
    // 获取邀请码
    Route::get('get-invite-code',"MemberController@getInviteCode");
    //  todo 会员消费商家产品
    Route::get("get-order-new", 'MemberOrderController@getOrderNew'); // 获取订单编号
    Route::post('order-pay','MemberOrderController@pay');
    Route::any('pay-notify',"MemberOrderController@notify");

    // 用户资金池提现申请
    Route::post("cash", "MemberCashController@cash");// 会员申请提现
    Route::get("cash-list", "MemberCashController@CashList");// 会员申请提现列表
    Route::get('wallet', 'MemberController@wallet');
    Route::get('wallet/orderList', 'MemberController@walletOrderList');

    // 用户分享提现申请
    Route::post("share-cash", "MemberCashController@shareCash");// 会员分享金申请提现
    Route::get("share-cash-list", "MemberCashController@shareCashList");// 会员分享金申请提现列表
    Route::post('/update', 'MemberController@update');//更新会员信息
});

Route::group(['prefix' => 'notify', 'middleware' => 'auth:app'], function () {
    //消息
    Route::get('/', 'MessageController@list');//消息列表
});

Route::post('feedback', 'FeedbackController@store');

Route::group(['prefix' => 'store'] , function () {
    Route::get('/{id}', 'StoreController@detail')->where('id', '[0-9]+');
    Route::post('comment', 'StoreController@commentStore')->middleware('auth:app');
    Route::get('comment', 'StoreController@comment');
    Route::get('recommend', 'StoreController@recommend');
    Route::get('comment/keys', 'StoreController@commentKeys');
});

Route::group(['prefix' => 'data'], function() {
    Route::get('order', 'MemberConsumeController@data');
    Route::get('orderList', 'MemberConsumeController@list');
});

// 测试商家申请体现分配比例
Route::get("/reflect", 'StoreController@reflect');


// todo 支付
//Route::any('/pay',"PayController@pay");
Route::group(['prefix' => 'pay','middleware' => 'auth:app'],function(){
    Route::post('wx-consume','MemberOrderController@consumePay');
    Route::post('wx-card','MemberOrderController@cardPay');

    //web支付
    Route::post('wx-web-consume','MemberOrderController@consumeWebPay');
    Route::post('wx-web-card','MemberOrderController@cardWebPay');

});

// todo 支付回调
Route::any("/pay/wx-notify","MemberOrderController@wxnotify");

Route::get("/version", 'VersionController@version');

Route::get('search', 'IndexController@search');